<?php
namespace app\common\validate;

use think\Validate;

class ProductValidate extends Validate{

    protected $rule = [
        'name'=>'require',    //名称可以相同 因为有分组
        'fun_cat'=>'require',
        'sys_cat'=>'require',
        'cover'=>'require'
    ];

    protected $message = [
        'name.require'=>'名称必填',
        'fun_cat.require'=>'功能分类必填',
        'sys_cat.require'=>'系统分类必填',
        'cover.require'=>'请上传封面图'
    ];

    protected $scene = [
        'add' => ['name','fun_cat','sys_cat','cover'],
        'edit' => ['name','fun_cat','sys_cat','cover'],
    ];
}